<style lang="scss">
	@import "uview-ui/index.scss";
</style>
<script>
import sdk from 'sdk'
import ajax from '@/api'

// #ifdef MP
import DevConfig from './env.dev.js'
import TestConfig from './env.test.js'
import PrevConfig from './env.prev.js'
import ProdConfig from './env.prod.js'
import ENV from 'utils/env'

function initBaseUrl() {
	let envConfig = {}
	switch (ENV) {
		case "development":
			envConfig = DevConfig
			break
		case "test":
			envConfig = TestConfig
			break
		case "prev":
			envConfig = PrevConfig
			break
		case "production":
			envConfig = ProdConfig
			break
	}
	ajax.setConfig({
		baseURL: envConfig.baseUrl
	})
}
initBaseUrl()
// #endif

export default {
	onLaunch: function() {
		console.log('App Launch')
	},
	onShow: function() {
		console.log('App Show')
		sdk.login({
			notCallLogin: true
		})

		// // 确保页面渲染完毕
		// setTimeout(()=> {
		// 	// vconsole 生产环境隐藏操作开启vconsole
		// 	// #ifdef H5
		// 	let vconsoleChecker = require('utils/listen-vconsole').default
		// 	vconsoleChecker()
		// 	// #endif
		// }, 100)
	},
	onHide: function() {
		console.log('App Hide')
	}
}
</script>

<style lang="less">
	/*每个页面公共css */
	@import '~@/style/index.less';
</style>